{% extends "common/layout_main.html" %}
{% block content %}
    {% include "common/tab_finance.html" %}
    <div class="row">
        <div class="col-lg-12">
            <form class="form-inline wrap_search">
                <div class="row  m-t p-w-m">
                    <div class="form-group">
                        <select name="status" class="form-control inline">
                            <option value="-1">请选择状态</option>
                            {% for tmp_key in pay_status_mapping %}
                                <option value="{{ tmp_key }}" {% if tmp_key == search_con['status'] %}
                                        selected {% endif %}>{{ pay_status_mapping[ tmp_key ] }}</option>
                            {% endfor %}
                        </select>
                    </div>
                </div>
            </form>
            <hr>
            <table class="table table-bordered m-t">
                <thead>
                <tr>
                    <th>订单编号</th>
                    <th>名称</th>
                    <th>价格</th>
                    <th>支付时间</th>
                    <th>状态</th>
                    <th>创建时间</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {% if list %}
                    {% for item in list %}
                        <tr>
                            <td>{{ item.order_number }}</td>
                            <td>
                                {% for item_food in item.foods %}
                                    {{ item_food.name }}  × {{ item_food.quantity }}
                                {% endfor %}
                            </td>
                            <td>{{ item.price }}</td>
                            <td>{{ item.pay_time }}</td>
                            {% if item.status_desc!="待发货" %}
                                <td>{{ item.status_desc }}</td>
                            {% else %}
                                <td id="countdown">请于{{ item.express_deadline }}前发货</td>
                            {% endif %}
                            <td>{{ item.created_time }}</td>
                            <td>
                                <a href="{{ buildUrl('/finance/pay-info') }}?id={{ item.id }}">
                                    <i class="fa fa-eye fa-lg"></i>
                                </a>
                            </td>
                        </tr>
                    {% endfor %}
                {% else %}
                    <tr>
                        <td colspan="7">暂无数据</td>
                    </tr>
                {% endif %}
                </tbody>
            </table>
            {% include 'common/pagenation.html' %}
        </div>
    </div>
{% endblock %}
{% block js %}
    <script src="{{ buildStaticUrl('/js/finance/index.js') }}"></script>
{% endblock %}

